package hx.entity; /***********************************************************************
 * Module:  NetPackage.java
 * Author:  Administrator
 * Purpose: Defines the Class NetPackage
 ***********************************************************************/

import hx.entity.MobileCard;
import hx.service.NetService;

import java.io.Serializable;
import java.util.*;

/** @pdOid 2953a6cb-4b8d-4df3-990e-d24409719756 */
public class NetPackage extends ServicePackage implements Serializable , NetService {
   /** @pdOid 7657b9cc-1ea5-425e-9a4d-ac49564c3bfd */
   private int flow;

   public NetPackage() {
      super(68);
      this.flow = 3074;
   }

   public int getFlow() {
      return flow;
   }

   public void setFlow(int flow) {
      this.flow = flow;
   }

   /** @pdOid 6d32fa26-03c8-4503-80a9-064bc35f95c3 */
   public void showInfo() {

   }

   @Override
   public void show() {
      System.out.println("套餐名字："+"\t"+"网虫");
      System.out.println("通话时长(分钟)："+"无");
      System.out.println("上网流量(Mb)："+"\t"+flow);
      System.out.println("短信条数(条)："+"\t"+"无");
      System.out.println("资费(元/月)："+"\t"+68);
   }
   @Override
   public void shouwInfo() {
      System.out.println("通话时长："+0+"分钟");
      System.out.println("短信条数："+0+"条");
      System.out.println("上网流量："+getFlow()+"Mb");
   }


   /** @param flow
    * @param card
    * @pdOid 974ec771-0d47-41c9-8cad-9440a810d335 */
   public int netPlay(int flow, MobileCard card) {
      double monet=card.getMoney();
      setFlow(this.flow-flow);
      if (getFlow()<0){
         card.setMoney(monet-getFlow()*(-0.1));
         setFlow(0);

      }
      return flow;
   }

}